<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"></meta>
    <title>${topic.title!''} - 有乐窝</title>
    <#include "../include/common.html">
        <link rel="stylesheet" href="../resource/css/knowledge.css"/>
        <script type="text/javascript">
            ulewo.topicId = "${topic.topicId?c}";
            ulewo.topicType = "K";
            ulewo.topicTitle = "${topic.title!''}";
            ulewo.editorWidth = 790
        </script>
        <script type="text/javascript" src="${absolutePath}/resource/js/attachment.js?version=2015129"></script>
        </head>
<body>
<#include "../include/top.html">
    <div class="main">
        <div class="navigation">
            <#if pCategory??>
                <a href="${absolutePath}/knowledge">知识库</a>
            </#if>
            <#if pCategory??>
                &nbsp;&gt;&nbsp;<a href="${absolutePath}/knowledge/pCategoryId/${pCategory.categoryId}">${pCategory.name}</a>
            </#if>
            <#if category??>
                &nbsp;&gt;&nbsp;<a
                    href="${absolutePath}/knowledge/categoryId/${category.categoryId}">${category.name}</a>
            </#if>
            &nbsp;&gt;&nbsp;<span>${topic.title}</span>
        </div>

        <div class="left">
            <a href="javascript:;" class="btn post-btn"><i
                    class="icon icon-post-knowledge"></i>&nbsp;&nbsp;<span>我要投稿</span></a>
            <div class="categories">
                <a href="${absolutePath}/knowledge" class="all-knowledge">全部知识库</a>
                <ul>
                    <#list categories as p>
                        <li>
                            <a href="${absolutePath}/knowledge/pCategoryId/${p.categoryId}">${p.name!''}</a>
                            <ul>
                                <#list p.children as c>
                                    <li><a href="${absolutePath}/knowledge/categoryId/${c.categoryId}"
                                        <#if categoryId??&&categoryId==c.categoryId>class="active"</#if>
                                        >${c.name!''}</a></li>
                                </#list>
                                <div class="clear"></div>
                            </ul>
                        </li>
                    </#list>
                </ul>
            </div>
        </div>
        <div class="right">
            <div class="right-main">
                <div class="topic-info-con">
                    <div class="topic-title">${topic.title!''}</div>
                    <div class="topic-info-d topic-count-info">
                        <a href="${absolutePath}/user/${topic.userId!''}" class="user-info"><i
                                class="icon icon-user-name"></i><span>${topic.userName!''}</span></a>
                        <span class="count"><i class="icon icon-read"></i><span>阅读：${topic.readCount!'0'}</span></span>
                        <span class="count"><i class="icon icon-comment"></i><span>评论：<span id="comment-count">${topic.commentCount!'0'}</span></span></span>
                        <span class="count"><i class="icon icon-like"></i><span>喜欢：<span id="like-count">${topic.likeCount!'0'}</span></span></span>
                        <span class="count"><i class="icon icon-collection"></i><span>收藏：<span id="collection-count">${topic.collectionCount!'0'}</span></span></span>
                    </div>
                </div>
                <div class="topic-detail">
                    ${topic.content!''}
                </div>
                <#if topic.file??>
                    <div class="attachment">
                        <div class="attachment-title">附件</div>
                        <div class="attachment-info">
                            <span class="filename"><i class="icon icon-package"></i>${topic.file.fileName!''}</span>&nbsp;&nbsp;
                            <span class="mark">所需积分：${topic.file.downloadMark!''}</span>&nbsp;&nbsp;
                            <span class="dccount">下载：<a href="javascript:void(0)"
                                                        attachmentid="${topic.file.attachmentId?c!''}" id="dcount">${topic.file.downloadCount!''}</a></span>&nbsp;&nbsp;
                            <a href="javascript:void(0)" class="btn" topicid=${topic.topicId?c}
                               attachmentid="${topic.file.attachmentId?c!''}" id="downloadFile">点击下载</a>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="${absolutePath}/get_mark" target="_blank">没有积分？</a>
                            <div id="attachedUser" style="display: none;"></div>
                        </div>
                    </div>
                </#if>
                <div class="like-users">
                    <#if (topic.likeUsers?size>0)>
                        <#list topic.likeUsers as like>
                            <a href="${absolutePath}/user/${like.userId}">${like.userName}</a>
                        </#list>
                        <span class="like-info">很喜欢这篇文章</span>
                    </#if>
                </div>
                <#include "../comment/comment.html">
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <script>
        $(".post-btn").click(function () {
            if (ulewo.user.userId == "") {
                ulewo.goLogin();
                return;
            }
            document.location.href = ulewo.absolutePath + "/knowledge/post_knowledge.action";
        });
    </script>
    <#include "../include/footer.html">
</body>
</html>
